package com.org.gundutubruk;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class CreditActivity extends Activity{
	ImageView scroll;
	static Thread t;
	boolean isRunning;
	@Override
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.credit_layout);		
        scroll=(ImageView)findViewById(R.id.scrolling);
        final Handler h = new Handler();
        isRunning=true;
        t = new Thread(){
            public void run(){
                int y = scroll.getScrollY();
                int x = scroll.getScrollX();
                while(y<1600&&isRunning){
                    // need final values to create anonymous inner class
                    final int X = x;
                    final int Y = y;
                    h.post(new Runnable() {
                        public void run() {
                            scroll.scrollTo(X, Y);
                        }
                    });
                    y+=2;
                    try {
                        sleep(1000/12);
                    } catch (InterruptedException e) {
                    }
                }
            }
        };
        t.start();
    }
	
	private void nextAct3() {
		this.startActivity(new Intent("android.intent.action.MENUUTAMA"));
		overridePendingTransition(R.anim.fade, R.anim.hold);
		this.finish();
		t=null;
	}
	
	public void onBackPressed(){
		isRunning=false;
		nextAct3();
	}
}
